package com.freestyle.sentinel;

import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.alibaba.csp.sentinel.slots.block.flow.FlowException;
import com.freestyle.sentinel.com.freestyle.sentinel.GlobalHandler;
import lombok.extern.slf4j.Slf4j;

/**
 * Created by rocklee on 2022/3/28 17:09
 */
@Slf4j
public class GlobalHandlerImp implements GlobalHandler {
  @Override
  public Object globalBlockHandler(BlockException flowException, MethodArgs methodArgs) {
     log.error("globalBlockHandler,method:{},pargs:{},return:{}",methodArgs.getMethod(),
             methodArgs.getArgs(),methodArgs.getReturnClass());
     return null;
  }

  @Override
  public Object globalFallBackHandler(Throwable throwable,MethodArgs methodArgs)  {
    log.error("globalFallBackHandler",throwable);
    return null;
  }
}
